package com.uiao.stone.controller;

import com.uiao.stone.common.annotation.CurrentUser;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

/**
 * @author uiao
 * @Title: CurrentDemoController
 * @Description: currentUser注解测试类
 * @date 2018/8/717:49
 */
@Controller
@RequestMapping(value = "current", method = RequestMethod.GET)
public class CurrentDemoController {

    org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(CurrentDemoController.class);

    @GetMapping("getname")
    public String converter(Map<String, Object> model, @CurrentUser String user) {
        logger.info("当前用户为 ==>>");
        logger.info(user);
        model.put("name", user);
        return "home";
    }

}
